<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    var arr = [
      {
        title:'申请书.png',
        src:'https://www.baidu.com/img/PCtm_d9c8750bed0b3c7d089fa7d55720d6cf.png'
      },
      {
        title:'离职书.png',
        src:'https://www.baidu.com/img/PCtm_d9c8750bed0b3c7d089fa7d55720d6cf.png'
      },
    ]
    // split 将字符串转成数组 
    // split('.') 将字符串转成以 . 分割的数组
    // 返回新产生的数组，不改变原数组
    arr.forEach(item=>{
      if(item.title.indexOf('.') != -1){
        item.title.split('.')[0]
        console.log(item.title.split('.')[0]);
      }
    })
    console.log(arr);
  </script>
</body>
</html>